package com.qst.crop.controller;

import com.github.pagehelper.PageInfo;
import com.qst.crop.common.Result;
import com.qst.crop.common.StatusCode;
import com.qst.crop.common.vo.LineShow;
import com.qst.crop.common.vo.Sheng;
import com.qst.crop.entity.Knowledge;
import com.qst.crop.service.DiscussService;
import com.qst.crop.service.KnowledgeService;
import com.qst.crop.service.MapService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Slf4j
@RequestMapping("/map")
public class MapControl {
    @Autowired
    private MapService mapService;
    @RequestMapping ("line")
    public Result<List<LineShow>> line() {

       List<LineShow> lines=mapService.line();
        return new Result<List<LineShow>>(true, StatusCode.OK,"加载成功",lines);
    }
    @RequestMapping("sheng")
    public Result<List<Sheng>> map() {

        List<Sheng>  maps=mapService.map();
        System.out.println("ffffffffffffff");
        System.out.println(maps);

        return new Result<List<Sheng>>(true, StatusCode.OK,"省份加载成功",maps);
    }
}
